package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.fabu.XjSpBean;
import com.lwj.liwanjia.impl.XjSpView;
import com.lwj.liwanjia.model.XjSpModel;

import java.util.Map;

import rx.Subscriber;

/**
 * Created by Administrator on 2018/1/12.
 */

public class XjSpPresneter {
    private XjSpView xjSpView;
    private XjSpModel xjSpModel;

    public XjSpPresneter(XjSpView xjSpView) {
        this.xjSpView = xjSpView;
        this.xjSpModel = new XjSpModel();
    }

    public void XjSpData(Map<String, Object> map) {
        xjSpModel.XjSpData(map, new Subscriber<XjSpBean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                xjSpView.showError((Exception) e);
            }

            @Override
            public void onNext(XjSpBean xjSpBean) {
                xjSpView.xjSpData(xjSpBean);
            }
        });
    }
}
